package com.seveneight.baijiesteward.utils;

import android.app.Activity;
import android.content.Context;
import android.support.annotation.NonNull;
import android.widget.Toast;

import com.afollestad.materialdialogs.DialogAction;
import com.afollestad.materialdialogs.MaterialDialog;
import com.seveneight.baijiesteward.R;

/**
 * Created by user1 on 2018/2/26.
 */

public class MMessageDialog {
    private MaterialDialog.Builder builder;
    private MaterialDialog dialog;

    public MMessageDialog(final Context context, String title) {
        if (builder == null) {
            builder = new MaterialDialog.Builder(context)
                    .content(title)
                    .contentColorRes(R.color.graytext)
                    .backgroundColorRes(R.color.white)
                    .positiveColorRes(R.color.mainblue)
                    .positiveText(R.string.positive);
            dialog = builder.build();
        }
    }

    public void showDialog() {
        dialog.show();
    }

    public void hideDialog() {
        if (dialog.isShowing()) {
            dialog.dismiss();
        }
    }
}
